package com.naiterui.ehp.bs.doctor.controller.inner;

import com.naiterui.ehp.bp.constants.SwaggerTag;
import com.naiterui.ehp.bp.utils.lang.StringUtil;
import com.naiterui.ehp.bs.doctor.service.IChargeService;
import java.util.Map;
import javax.validation.constraints.NotNull;

import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * 医生服务收费内部API Controller
 *
 * @author gaoliangliang
 * @date 2021/1/26 上午8:45
 **/
@Slf4j
@RestController
@RequestMapping("ad/inner/charge")
@RequiredArgsConstructor
@Api(tags = {SwaggerTag.DOCTOR + SwaggerTag.INNER_API + SwaggerTag.SERVICE_CHARGE})
public class AdInnerChargeController {

    private final IChargeService chargeService;

    @GetMapping
    public Map<Long,Integer> chargeInfo(
        @NotNull(message = "医生ID不能为空") String doctorIds,
        @NotNull(message = "收费服务类型不能为空") Integer type) {
        log.info("批量获取医生服务收费金额，参数为：doctorIds={},type={}", doctorIds, type);
        Map<Long,Integer> chargeMap = this.chargeService.getDoctorCharge(StringUtil.convertLongStr2List(doctorIds,","), type);
        return chargeMap;
    }
}
